package com.example.djetpack.viewmodel

import android.media.MediaCodec
import android.media.MediaFormat
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import com.example.djetpack.R


class ViewModelActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_view_model)

        var myViewModel = ViewModelProvider(this).get(MyViewModel::class.java)
        myViewModel.fetchMessageData()
        myViewModel.mMessageLiveData.observe(this, Observer {
            Log.d(TAG, "onCreate: $it")
        })
       // val mediaCodec = MediaCodec.createDecoderByType(MediaFormat.MIMETYPE_VIDEO_AVC)
        var savedStateViewModel = ViewModelProvider(this).get(SavedStateViewModel::class.java)
    }

    companion object {
        private const val TAG = "ViewModelActivity"
    }
}